#pragma once
#ifndef LIT__FILE__PARSER__HH__
#define LIT__FILE__PARSER__HH__

#include <fstream>
#include <string>
#include <LitPrerequisites.h>

namespace Lit
{
	namespace Editor
	{
		class LIT_API FileLineParser
		{
		public:
			struct Line
			{
				std::string line;
				size_t		id;
			};

		protected:
			std::ifstream	mStream;
			size_t			mRefLine;
		public:
			FileLineParser( const std::string &filename, bool binary = false );
			FileLineParser( );
			virtual ~FileLineParser( );

			operator bool() const;

			bool isOpen() const;
			bool isGood() const;

			size_t getCurrentLine( ) const;

			bool eof() const;

			FileLineParser& operator >>( Line& line );
			FileLineParser& operator >>( std::string& line );

			bool open( const std::string &filename, bool binary = false );
			bool close();
		};
	};
};

#endif